<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@include file="/inner/head.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<script type="text/javascript" src="${basepath}/res/js/plugin/ckeditor/ckeditor.js" charset="utf-8"></script>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}
-->
</style>
<script>
	$(document).ready(function() {
      	setNoPageBarDivHeight();
		  var _toolbar =      
							[      
							    ['Source','Bold','Italic','Underline'],      
							    ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],      
							    ['Styles','FontSize'], 
							    ['Link','Unlink'],
							    ['Table'],     
							    ['TextColor']
							]; 
		  CKEDITOR.replace('content',{width:'750',height:'250',uiColor:'#BFEFFF',skin:'office2003',language:'zh-cn',toolbar:_toolbar});
	});
	function update(){
		if(!document.getElementById("title").value){
			jError("标题不能为空",null, function(r){
				document.getElementById("title").focus();
			});
			return false;
		}
		var oEditor = CKEDITOR.instances.content;
		var content = oEditor.getData();
		$("#content").val(content);
		var url="${basepath}/news?m=update";
		var options = {
			url: url,
			type: 'post',
			dataType: 'json',
			success: function(data){
				jSuccess("修改成功!", null, function(r){
					location.href="${basepath}/news?m=search";
				});
			}
		};
		$("#newsform").ajaxSubmit(options);
	}
</script>
</head>
<body>
  <form id="newsform" name="newsform">
  <input name="id" id="id" value="${news.id}" type="hidden">
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" >
  	<tr>
      <td height="30">
      	<table width="100%" border="0" cellspacing="0" cellpadding="0">
      	  <tr>
        	<td height="24" bgcolor="#353c44">
        	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
          	    <tr>
            	  <td>
            	    <table width="100%" border="0" cellspacing="0" cellpadding="0">
              		  <tr>
                	    <td width="2%" height="19" valign="bottom"><div align="center"><img src="${basepath}/res/image/tb.gif" width="14" height="14" /></div></td>
                	    <td width="98%" valign="bottom"><span class="STYLE1"> 修改新闻</span></td>
              		  </tr>
            	    </table>
            	  </td>
          	    </tr>
        	  </table>
            </td>
      	  </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td>
        <div id="dataDiv" class="scrollDiv" >
      	<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
       	  <tr>
        	<td height="30" width="20%" bgcolor="#FFFFFF" class="STYLE19" align="right">标题：</td>
        	<td bgcolor="#FFFFFF" class="STYLE19" align="left">&nbsp;<input id="title" name="title" title="标题" style="width: 400px" value="${news.title}"><font color="red">&nbsp;*</font></td>
      	  </tr>
      	  <tr>
        	<td height="30" width="20%" bgcolor="#FFFFFF" class="STYLE19" align="right">内容：</td>
        	<td bgcolor="#FFFFFF" class="STYLE19" align="left">&nbsp;
        	  <textarea id="content" name="content" style="margin-top: 5px;margin-bottom: 5px;" title="内容">${news.content}</textarea>
        	  <font color="red">&nbsp;*</font></td>
      	  </tr>
      	  <tr>
        	<td height="30" width="20%" bgcolor="#FFFFFF" class="STYLE19" align="right">是否公开：</td>
        	<td bgcolor="#FFFFFF" class="STYLE19" align="left">&nbsp;
			  <input value="1" type="radio" name="pub" id="pub1" ${news.pub==1?'checked':''}/>是
              <input value="0" type="radio" name="pub" id="pub2" ${news.pub==0?'checked':''}/>否
			</td>
      	  </tr>
      	  <tr>
        	<td height="100" width="20%" bgcolor="#FFFFFF" class="STYLE19" align="center" colspan="4" id="idMsg"> 
        	  <img src="${basepath}/res/image/qd.jpg" width="59" height="22" onclick="update();" title="提交" style="cursor: pointer;">
        	  <img src="${basepath}/res/image/cz.jpg" width="59" height="22" onclick="newsform.reset();" title="重置" style="cursor: pointer;">
        	</td>
      	  </tr>
  		</table>
  		</div>
  	  </td>
  	</tr>
  </table>
  </form>
</body>

